# $Id: PKGBUILD 184352 2013-05-06 17:20:30Z heftig $
# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=gnome-control-center
pkgver=3.8.1.5
pkgrel=1
pkgdesc="The Control Center for GNOME"
license=(GPL)
arch=(i686 x86_64)
depends=(accountsservice cups-pk-helper gnome-bluetooth gnome-desktop gnome-menus
         gnome-online-accounts gnome-settings-daemon gsettings-desktop-schemas gtk3
         libgtop network-manager-applet sound-theme-freedesktop upower libpwquality
         gnome-color-manager smbclient modemmanager)
makedepends=(gnome-doc-utils intltool docbook-xsl)
optdepends=('system-config-printer: Printer settings'
            'gnome-user-share: Bluetooth and WebDAV file sharing'
            'rygel: media sharing'
            'vino: screen sharing'
            'openssh: remote login')
groups=(gnome)
url="http://www.gnome.org"
install=gnome-control-center.install
options=('!libtool' '!emptydirs')
source=(http://download.gnome.org/sources/$pkgname/${pkgver::3}/$pkgname-$pkgver.tar.xz)
sha256sums=('6756a97eb8e89fe16bd5e50ab85d7f0e4e0fb7fa4e9df5ab49a97de03033d211')

build() {
  cd $pkgname-$pkgver

  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
      --libexecdir=/usr/lib/$pkgname --disable-static

  #https://bugzilla.gnome.org/show_bug.cgi?id=656229
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' -e 's/    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then/      func_append compile_command " -Wl,-O1,--as-needed"\n      func_append finalize_command " -Wl,-O1,--as-needed"\n\0/' libtool
  make
}

package() {
  cd $pkgname-$pkgver

  make DESTDIR="$pkgdir" install

  # Fix a warning
  chown 102:0 "$pkgdir/usr/share/polkit-1/rules.d"
  chmod 700 "$pkgdir/usr/share/polkit-1/rules.d"
}
